<?php


namespace app\meetyou\controller;

use library\Controller;

/**
 * 会员信息认证
 * Class Verified
 * @package app\meetyou\controller
 */
class Verified extends Controller {
    /**
     * 绑定数据表
     * @var string
     */
    protected $table = 'meetyou_member_info';

    /**
     * 会员认证管理
     * @auth true
     * @menu true
     * @throws \think\Exception
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * @throws \think\exception\PDOException
     */
    public function index() {
        $this->title = '会员认证管理';
        $this->_query($this->table)->alias('i')
            ->join(' meetyou_member m ', 'm.id=i.mid')
            ->equal('verified')
            ->like('m.nickname#nickname,m.phone#phone')
            ->field('m.id,m.account,m.nickname,m.realname,m.phone,m.spare_phone,m.avatar,i.*')
            ->dateBetween('i.create_at#create_at')
            ->order('i.create_at desc')
            ->page();
    }

    /**
     * 编辑认证信息
     * @auth true
     * @throws \think\Exception
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * @throws \think\exception\PDOException
     */
    public function edit() {
        $this->title = '编辑认证信息';
        $this->isAddMode = '0';
        $this->_form($this->table, 'form');
    }
}